<!DOCTYPE html>
<html lang="zh">

<head>
    <meta charset="utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta http-equiv="Cache-Control" content="no-siteapp" />
    <meta name="renderer" content="webkit" />
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" />
    <meta name="keywords"
        content="Editor.md,editor,Markdown Editor,Markdown,编辑器,Markdown编辑器,Markdown在线编辑器,在线编辑器,开源编辑器,开源Markdown编辑器" />
    <meta name="description" content="Editor.md: a simple online markdown editor. 开源在线 Markdown 编辑器" />
    <title>HTML Preview(markdown to html) - Editor.md examples</title>
    <link rel="stylesheet" href="../../css/editormd.preview.css" />
    <style>
        body{overflow-x: hidden;padding-right:30px;}
    </style>
</head>

<body>
    <div id="test-editormd-view">
        <textarea style="display:none;" name="test-editormd-markdown-doc">###Hello world!</textarea>
    </div>
    <div id="test-editormd-view2">
        <textarea id="append-test" style="display:none;">

        </textarea>
    </div>


    <script src="../../js/jquery.min.js"></script>
    <script src="../../lib/marked.min.js"></script>
    <script src="../../lib/prettify.min.js"></script>

    <script src="../../lib/raphael.min.js"></script>
    <script src="../../lib/underscore.min.js"></script>
    <script src="../../lib/sequence-diagram.min.js"></script>
    <script src="../../lib/flowchart.min.js"></script>
    <script src="../../lib/jquery.flowchart.min.js"></script>

    <script src="../../editormd.js"></script>
    <script type="text/javascript">
        $(function () {

            var testEditormdView, testEditormdView2;
            var type = getUrlParam('type') || 'layer'
            getdata("./" + (type) + ".md")
           
            function getdata(url) {
                $.get(url, function (markdown) { // "./md/vue-tv-focusable.md"
                    testEditormdView = editormd.markdownToHTML("test-editormd-view", {
                        markdown: markdown,//+ "\r\n" + $("#append-test").text(),
                        htmlDecode: "style,script,iframe",  // you can filter tags decode
                        tocm: true,    // Using [TOCM]
                        emoji: true,
                        taskList: true,
                        tex: true,  // 默认不解析
                        flowChart: true,  // 默认不解析
                        sequenceDiagram: true,  // 默认不解析
                    });
                    $('.bg').hide();
                });
            }


            testEditormdView2 = editormd.markdownToHTML("test-editormd-view2", {
                htmlDecode: "style,script,iframe",  // you can filter tags decode
                emoji: true,
                taskList: true,
                tex: true,  // 默认不解析
                flowChart: true,  // 默认不解析
                sequenceDiagram: true,  // 默认不解析
            });

            //获取url中的参数
            function getUrlParam(name) {
                var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)"); //构造一个含有目标参数的正则表达式对象
                var r = window.location.search.substr(1).match(reg); //匹配目标参数
                if (r != null) return unescape(r[2]); return null; //返回参数值
            }
        });
    </script>
    <style>
        #cnzz_stat_icon_1254310986 {
            display: none;
        }
    </style>
    <script
        type="text/javascript">var cnzz_protocol = (("https:" == document.location.protocol) ? " https://" : " http://"); document.write(unescape("%3Cspan id='cnzz_stat_icon_1254310986'%3E%3C/span%3E%3Cscript src='" + cnzz_protocol + "s11.cnzz.com/stat.php%3Fid%3D1254310986%26show%3Dpic' type='text/javascript'%3E%3C/script%3E"));</script>
</body>

</html>